package com.ambow.shop.action.impl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ambow.shop.action.Action;
import com.ambow.shop.service.ProductService;
import com.ambow.shop.service.impl.ProductServiceImpl;

/**
 * 删除产品业务流程。
 * 
 * @author chunw
 *
 */
public class DeleteProductAction implements Action {

	private ProductService productService = new ProductServiceImpl();

	@Override
	public String execute(HttpServletRequest request, HttpServletResponse response) {
		// 获取产品标识；
		Integer productId = Integer.parseInt(request.getParameter("id"));
		productService.deleteProduct(productId);
		return "../product/list";
	}

}
